package com.yueman.ptoolopenticket.ticket.mapper;

import com.yueman.ptoolopenticket.ticket.pojo.Trace;
import org.apache.ibatis.annotations.Param;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Modifying;
import org.springframework.data.jpa.repository.Query;
import org.springframework.transaction.annotation.Transactional;

public interface TicketTraceRepository extends JpaRepository<Trace, Integer> {

    Trace findTracesByUpOrderId(String UpOrderId);

    Trace findTracesByInAcctNo(String AcctNo);

    @Query("update Trace t set t.payStatus=:#{#trace.payStatus},t.tradeStatus=:#{#trace.tradeStatus} where t.orderNumber=:#{#trace.orderNumber}")
    @Modifying
    @Transactional
    Integer updateTraceStatus(@Param("trace") Trace trace);
}
